package com.bcbim.operation_maintenance.space_type.service;

import com.bcbim.operation_maintenance.space_type.mapper.SpaceTypeMapper;
import com.bcbim.operation_maintenance_interface.space_type.dao.SpaceTypeDAO;
import com.bcbim.operation_maintenance_interface.space_type.dto.SpaceTypeUnassignedDTO;
import com.bcbim.operation_maintenance_interface.space_type.service.SpaceTypeService;
import com.bcbim.operation_maintenance_interface.space_type.vo.SpaceTypeVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：空间类型service实现类
 * @Author: haomeijie
 * @Date: 2022/3/5 13:08
 **/
@Service(timeout = 60 * 1000, group = "spaceType", version = "1.0.0")
public class SpaceTypeServiceImpl implements SpaceTypeService {
    @Autowired
    private SpaceTypeMapper spaceTypeMapper;

    @Override
    public int insertSpaceType(SpaceTypeDAO spaceTypeDAO) {
        return spaceTypeMapper.insertSpaceType(spaceTypeDAO);
    }

    @Override
    public int updateSpaceType(SpaceTypeDAO spaceTypeDAO) {
        return spaceTypeMapper.updateSpaceType(spaceTypeDAO);
    }

    @Override
    public SpaceTypeVO getSpaceType(String id) {
        return spaceTypeMapper.getSpaceType(id);
    }

    /**
     * 查询类别下的类型
     *
     * @param id
     * @author xuehao
     * @createDate 2022/3/10 14:07
     * @retuen List<String>
     */
    @Override
    public List<String> getSpaceTypeId(String id) {
        return spaceTypeMapper.getSpaceTypeId(id);
    }

    @Override
    public String getUnassignedId(SpaceTypeUnassignedDTO typeUnassignedDTO) {
        return spaceTypeMapper.getUnassignedId(typeUnassignedDTO);
    }

    @Override
    public int checkSpaceType(String spaceType, String spaceCategoryId, String id) {
        return spaceTypeMapper.checkSpaceType(spaceType, spaceCategoryId, id);
    }
}
